home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
008a
/
fdate42c.zip
/
TIC.BAT
< prev
Wrap
DOS Batch File
|
1992-01-10
|
6KB
|
169 lines
@echo off
goto endcomment
revision history
================
Jan 7, 1992
Added ADDDOW function for regular weekly appointments
:endcomment
REM TicBAT points to the tickler batch file
set TicBAT=C:\TICKLER.BAT
set ticdat=
set ticdow=
set ticmsg=
set tictmp=
if (%1)==() goto HELP
for %%v in (ed Ed ED edit Edit EDIT) do if (%%v)==(%1) goto EDIT
for %%v in (dow DOW Dow DoW) do if (%%v)==(%1) goto adddow
if (%2)==() goto LIST
:ADD
rem -------------------------------------------------------------
rem use a batch file to set ticdat, because it will display full error
rem message if bad date has been passed in via parm %1
rem -------------------------------------------------------------
Fdate /Ff /A%1 /Imm-dd-yy /Omm-dd-ccyy /P"@set ticdat=">junktemp.BAT
call junktemp.BAT
del junktemp.BAT
if errorlevel 1 goto endit
set tictmp=%0 %1
shift
set ticmsg=%1
shift
:LOOPTOP1
if (%1)==() goto LOOPEND1
set ticmsg=%ticmsg% %1
shift
goto LOOPTOP1
:LOOPEND1
if exist %TicBAT% goto exists1
echo @echo off >> %TicBAT%
:exists1
echo if (%%today%%)==(%ticdat%) echo %ticmsg%>>%TicBAT%
CLS
%tictmp%
goto endit
:ADDDOW
set tictmp=%0 %1
rem -------------------------------------------------------------
rem use a batch file to set ticdat, because it will display full error
rem message if bad date has been passed in via parm %1
rem -------------------------------------------------------------
set ticdow=
for %%v in ( 1 2 3 4 5 6 7 ) do if (%2)==(%%v) set ticdow=%2
if (%ticdow%)==() echo Invalid day-of-week number: %2
if (%ticdow%)==() goto endit
shift
shift
set ticmsg=%1
shift
:LOOPTOP2
if (%1)==() goto LOOPEND2
set ticmsg=%ticmsg% %1
shift
goto LOOPTOP2
:LOOPEND2
IF (%TICDOW%)==(1) SET TICMSG=%ticmsg% [REGULAR SUNDAY APPOINTMENT]
IF (%TICDOW%)==(2) SET TICMSG=%ticmsg% [REGULAR MONDAY APPOINTMENT]
IF (%TICDOW%)==(3) SET TICMSG=%ticmsg% [REGULAR TUESDAY APPOINTMENT]
IF (%TICDOW%)==(4) SET TICMSG=%ticmsg% [REGULAR WEDNESDAY APPOINTMENT]
IF (%TICDOW%)==(5) SET TICMSG=%ticmsg% [REGULAR THURSDAY APPOINTMENT]
IF (%TICDOW%)==(6) SET TICMSG=%ticmsg% [REGULAR FRIDAY APPOINTMENT]
IF (%TICDOW%)==(7) SET TICMSG=%ticmsg% [REGULAR SATURDAY APPOINTMENT]
if exist %TicBAT% goto exists2
echo @echo off >> %TicBAT%
:exists2
echo if (%%ticdow%%)==(%ticdow%) echo %ticmsg%>>%TicBAT%
CLS
echo Added: %ticmsg%
goto endit
:HELP
REM use ansi.sys to set color to blue
echo
cls
echo ┌─────────────────────────────────────────────────────────────────────────────┐
echo │ TIC.BAT : maintains and displays TICKLER.BAT, an automated tickler file. │
echo │═════════════════════════════════════════════════════════════════════════════│
echo │ Usage : TIC displays this HELP screen │
echo │─────────────────────────────────────────────────────────────────────────────│
echo │ Usage : TIC T displays today's appointments │
echo │ Usage : TIC TODAY displays today's appointments │
echo │─────────────────────────────────────────────────────────────────────────────│
echo │ Usage : TIC ED (or TIC EDIT) calls text editor to edit TICKLER.BAT │
echo │─────────────────────────────────────────────────────────────────────────────│
echo │ Usage : TIC mm/dd/yy displays appointments for date mm/dd/yy │
echo │ EXAMPLE : TIC 2/2/92 displays appointments for Feb 2, 1992 │
echo │ EXAMPLE : TIC 2/2/tt displays appointments for Feb 2 of this year │
echo │─────────────────────────────────────────────────────────────────────────────│
echo │ Usage : TIC mm/dd/yy words ... adds an appointment for date │
echo │ [mm/dd/yy] to TICKLER.BAT │
echo │ EXAMPLE : TIC 2/2/92 Quality Improvement committee meeting @ 10 am │
echo │ EXAMPLE : TIC 2/2/tt Quality Improvement committee meeting @ 10 am │
echo │─────────────────────────────────────────────────────────────────────────────│
echo │ Usage : TIC DOW dow# words ... adds a regular appointment │
echo │ for [dow#] day to TICKLER.BAT │
echo │ EXAMPLE : TIC DOW 2 Regular Monday-morning staff meeting @ 8:30 │
echo └─────────────────────────────────────────────────────────────────────────────┘
REM use ansi.sys to set color to normal default colors
echo
A
goto endit
REM ==================================================================
:EDIT
SPFPC %TicBAT%
goto endit
REM ==================================================================
:LIST
if not exist %TicBAT% goto endit
rem ------- call batch files to set TODAY and TICDOW Evars -------
Fdate /Ff /A%1 /Imm-dd-yy /Omm-dd-ccyy /P"@set today=">junktemp.BAT
call junktemp.BAT
Fdate /Ff /A%1 /Imm-dd-yy /Odow# /P"@set ticdow=">junktemp.BAT
call junktemp.BAT
del junktemp.BAT
rem --------------------------------------------------------------
: If you have GET, you can replace the previous lines with these.
: Remove the ":" from before the FDATE command and things should
: work fine. Use :, not REM to comment out lines that contain
: the DOS pipe symbol "|". Otherwise you may hang your machine.
rem -------- pipe Fdate output to GET to set TODAY evar ----------
: Fdate /Ff /A%1 /Imm-dd-yy /Omm-dd-ccyy | GET ZE /Vtoday >nul
: Fdate /Ff /A%1 /Imm-dd-yy /Odow# | GET ZE /Vticdow>nul
rem --------------------------------------------------------------
if (%today%)==(ERROR) echo Invalid date parameter [%1] received by %0
if (%today%)==(ERROR) goto endit
echo ───────────────────────────────────────────────────────────────────────────────
FDATE /ff /A%today% /Imm-dd-ccyy /Od1 /P"APPOINTMENTS & THINGS TO DO: "
echo ───────────────────────────────────────────────────────────────────────────────
CALL %TicBAT%
:endit
set ticdow=
set ticdat=
set ticmsg=
set TicBAT=